﻿using DzInfo.Tools.Web;
using Kingdee.BOS;
using Kingdee.BOS.Contracts;
using Kingdee.BOS.Core;
using System;

namespace DzInfo.DzSchedule.LianKe
{
    public class WebpageConverter : IScheduleService
    {
        public async void Run(Context ctx, Schedule schedule)
        {
            var options = new PdfGeneratorOptions
            {
                // 自定义选项
                ExtraLoadingTime = 5000,
                LogAction = msg => Console.WriteLine($"[LOG] {DateTime.Now}: {msg}")
            };
            var generator = new PdfGenerator(options);

            await generator.GeneratePdfAsync(
               //url: "http://192.168.43.22:8100/#/de-link/bzmkwDMb",
               url: "https://www.baidu.com/",
               outputPath: @"E:\test.pdf",
               chromePath: @"D:\Program Files\chrome-win64\chrome.exe"
           );
        }
    }
}
